import request from '../api/request'

//上传文件
export function uploadFile(data) {
  return request({
    url: '/upload/ossFile',
    method: 'post',
    data,
    headers:{'Content-Type':'multipart/form-data'},
    type:'file'
  })
}
//注册
export function register(data) {
  return request({
    url: '/user/info/register',
    method: 'post',
    data:data
  })
}
//登录
export function login(data) {
  return request({
    url: '/oauth/token',
    method: 'post',
    data:data
  })
}
//登录im
export function loginIm(data) {
  return request({
    url: '/user/info/loginIm',
    method: 'post',
    data:data
  })
}
//获取用户信息
export function getInfo(data) {
  return request({
    url: '/user/info/info',
    method: 'get',
    params:data
  })
}
//修改用户信息
export function changeInfo(data) {
  return request({
    url: '/user/info/update',
    method: 'post',
    data:data
  })
}
//修改用户信息
export function changeHeadImg(data) {
  return request({
    url: '/user/info/upHeadImg',
    method: 'post',
    data:data
  })
}
//修改群头像
export function changeGroupHeadImg(data) {
  return request({
    url: '/user/imRoomInfo/upHeadImg',
    method: 'post',
    data:data
  })
}
//搜索好友
export function searchUser(data) {
  return request({
    url: '/user/info/search',
    method: 'get',
    params:data
  })
}
//添加好友
export function addUser(data) {
  return request({
    url: '/user/imuserfriendship/save',
    method: 'post',
    data:data
  })
}
//好友列表
export function friendsList(data) {
  return request({
    url: '/user/imuserfriendship/list',
    method: 'get',
    params:data
  })
}
//好友申请列表
export function joinList(data) {
  return request({
    url: '/user/friend/joinList',
    method: 'get',
    params:data
  })
}
//拒绝添加好友
export function refuseJoin(data) {
  return request({
    url: '/user/friend/refuseJoin',
    method: 'get',
    params:data
  })
}
//修改好友备注
export function upFriendRemark(data) {
  return request({
    url: '/user/info/upFriendRemark',
    method: 'post',
    data:data
  })
}
//删除好友
export function delFriend(data) {
  return request({
    url: '/user/info/delFriend',
    method: 'post',
    data:data
  })
}
//创建群
export function createGroup(data) {
  return request({
    url: '/user/imroominfo/add',
    method: 'post',
    data:data
  })
}
//群聊列表
export function groupList(data) {
  return request({
    url: '/user/imroominfo/pageList',
    method: 'get',
    params:data
  })
}
//群成员列表
export function groupMemberList(data) {
  return request({
    url: '/user/imroomusership/pageList',
    method: 'get',
    params:data
  })
}
//批量删除群成员
export function deleteGroupMember(data) {
  return request({
    url: '/user/imroomusership/batchDelRoomFriend',
    method: 'post',
    data:data
  })
}
//批量添加群成员
export function addGroupMember(data) {
  return request({
    url: '/user/imroomusership/add',
    method: 'post',
    data:data
  })
}
//设置和取消管理员
export function upnickNameRole(data) {
  return request({
    url: '/user/imroomusership/upnickNameRole',
    method: 'post',
    data:data
  })
}
//群可加好友列表
export function groupFriendList(data) {
  return request({
    url: '/user/imuserfriendship/roomFridenList',
    method: 'get',
    params:data
  })
}
//修改群公告/简介/名称
export function upNoticeRemarks(data) {
  return request({
    url: '/user/imRoomInfo/upNoticeRemarks',
    method: 'post',
    data:data
  })
}
//禁言||取消禁言
export function upnickSet(data) {
  return request({
    url: '/user/imroomusership/upnickSet',
    method: 'post',
    data:data
  })
}
//禁言成员列表
export function forbidSpeechList(data) {
  return request({
    url: '/user/imroomusership/forbidSpeechList',
    method: 'get',
    params:data
  })
}
//解散群
export function breakGroup(data) {
  return request({
    url: '/user/imroomInfo/delRoom',
    method: 'post',
    data:data
  })
}
//退出群
export function quitGroup(data) {
  return request({
    url: '/user/imroomusership/delRoomFriend',
    method: 'post',
    data:data
  })
}
//好友聊天历史
export function chatList(data) {
  return request({
    url: '/user/message/chatList',
    method: 'get',
    params:data
  })
}
//群聊天历史
export function roomChatList(data) {
  return request({
    url: '/user/message/roomChatList',
    method: 'get',
    params:data
  })
}
//获取最新消息列表
export function newChatList(data) {
  return request({
    url: '/user/message/newChatList',
    method: 'get',
    params:data
  })
}